home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 3
/
ct-rom iiib.zip
/
ct-rom iiib
/
WINDOWS
/
DIVERSEN
/
WINE02BX
/
LIFE.ELC
< prev
next >
Wrap
Text File
|
1993-03-28
|
5KB
|
23 lines
;;; compiled by jwz@thalidomide on Thu Jul 2 16:36:57 1992
;;; from file /u/jwz/emacs19/lisp/packages/life.el
;;; emacs version 19.2.1 Lucid.
;;; bytecomp version 2.07; 17-jun-92.
;;; optimization is on.
;;; this file uses opcodes which do not exist in Emacs18.
(if (and (boundp 'emacs-version)
(or (and (boundp 'epoch::version) epoch::version)
(string-lessp emacs-version "19")))
(error "This file was compiled for Emacs19."))
(provide 'life)
(defconst life-patterns [("@@@" " @@" "@@@") ("@@@ @@@" "@@ @@ " "@@@ @@@") ("@@@ @@@" "@@ @@" "@@@ @@@") ("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@") ("@@@@@@@@@@") (" @@@@@@@@@@ " " @@@@@@@@@@ " " @@@@@@@@@@ " "@@@@@@@@@@ " "@@@@@@@@@@ ") ("@" "@" "@" "@" "@" "@" "@" "@" "@" "@" "@" "@" "@" "@" "@") ("@ @" "@ @" "@ @" "@ @" "@ @" "@ @" "@ @" "@ @" "@ @" "@ @" "@ @" "@ @" "@ @" "@ @" "@ @") ("@@ " " @@ " " @@ " " @@ " " @@ " " @@ " " @@ " " @@ " " @@ " " @@ " " @@ " " @@ " " @@ " " @@ " " @@ " " @@") ("@@@@@@@@@" "@ @ @" "@ @@@@@ @" "@ @ @ @" "@@@ @@@" "@ @ @ @" "@ @@@@@ @" "@ @ @" "@@@@@@@@@")] "\
Vector of rectangles containing some Life startup patterns.")
(byte-code "└┴┬Mê├─Mê┼╞Mê╟╚Mê╔╩Mê╦╠Mê═╬Mê╧╨Mê╤╥Mê╙╘Mê╒╓Mê╫╪Mê┘┌Mê█!ê▄▄▄▄ ßΓMç" [require life-life-char (macro lambda nil 64) life-death-char (macro lambda nil 65) life-birth-char (macro lambda nil 3) life-void-char (macro lambda nil 32) life-life-string (macro . #[nil "└┴!ç" [char-to-string 64] 2]) life-death-string (macro . #[nil "└┴!ç" [char-to-string 65] 2]) life-birth-string (macro . #[nil "└┴!ç" [char-to-string 3] 2]) life-void-string (macro . #[nil "└┴!ç" [char-to-string 32] 2]) life-not-void-regexp (macro . #[nil "└┴┬Qç" ["[^" " " "\n]"] 3]) goto-beginning-of-buffer (macro . #[nil "└ç" [(goto-char 1)] 1]) maxint (macro . #[nil "└ë┴┬\"┴\"ç" [lsh -1 1] 4]) goto-end-of-buffer (macro . #[nil "└ç" [(goto-char (maxint))] 1]) increment (macro . #[(variable) "└ ┬ DEç" [setq variable 1+] 4]) life nil life-neighbor-deltas life-window-start life-current-generation life-generation-string abs #[(n) "┴W½â[çç" [n 0] 2]] 3)
(fset 'life #[(&optional sleeptime) "¼é┴┬ ê├!ê─╞ ê╟ ê╚ ê├!ê)¬n" [sleeptime 1 life-setup life-display-generation t inhibit-quit life-grim-reaper life-expand-plane-if-needed life-increment-generation] 2 "\
Run Conway's Life simulation.
The starting pattern is randomly selected. Prefix arg (optional first arg
non-nil from a program) is the number of seconds to sleep between
generations (this defaults to 1)." "p"])
(byte-code "└┴Mê┬└├─#ê┼╞!ê╟╚Mê╔╩Mê╦╠Mê═╬Mê╧╨Mê╤╥Mê╙╘Mê╒╓Mê┬╫╪┘#ê┬╫┌█#ç" [life-mode life put mode-class special random t life-setup #[nil "└┬├─!┼\"ê╞ ê╟ ê└╔\n╦┼╬╨╥╘ S╓╪p!ê┘ ê╓bê┌█└┼#½ê▄▌┼ë#ê¬q╓bêè└ê`)Z▐Ñm¼ê jê└yê¬u▀ Sαed\"Z▐Ñ╓bêß !êΓbêß !ê╓bêm¼ÿ└êjêπ!ê`└ê`|ê└yê¬eΣed\"êσ êµ )ç" [nil n switch-to-buffer get-buffer-create "*Life*" t erase-buffer kill-all-local-variables case-fold-search "Life" mode-name life-mode major-mode truncate-lines 0 life-current-generation "0" life-generation-string ("Life: generation " life-generation-string) mode-line-buffer-identification window-width fill-column 1 life-window-start buffer-disable-undo life-insert-random-pattern re-search-forward "[^ \n]" replace-match "@" 2 window-height count-lines newline 33554431 move-to-column untabify life-expand-plane-if-needed life-compute-neighbor-deltas] 4] life-compute-neighbor-deltas #[nil "└ [ T[ ┬\\[├ ëT ┬\\»ëç" [-1 fill-column 2 1 life-neighbor-deltas] 9] life-insert-random-pattern #[nil "└ ┬├ ! Gª£!ê─cç" [insert-rectangle life-patterns abs random 10] 4] life-increment-generation #[nil "T┴!ëç" [life-current-generation int-to-string life-generation-string] 2] life-grim-reaper #[nil "└┴!ê┬bê┴ëëëë╚╔┴╩#½∞╠`S½╤@\\ëfë═=½î╬ëT═┬╩%ê¬░╧W½Ä╬ëTëT╩%ꬣ╨W½ì╬ëT╨╩%ê¬ë╤Y½âTAë¼/╥>¼╬ëT╤╙╩%ê¬-╠ö¼â╘ ê╬┬d╨═╩%ê╬┬d┬═╩%ê╬┬d╒═╩%ê╬┬d╧╤╩%ê╬┬d╙═╩%ç" [store-match-data nil 1 list living-neighbors pivot char point search-forward "@" t life-neighbor-deltas 0 32 subst-char-in-region 3 9 64 (2 3) 65 life-extinct-quit 2] 7] life-expand-plane-if-needed #[nil "└┴ìê┬bê├─`ë╞\\\\\\╟#½¢┬bê╚╔\"ê╩cê╚╔\"ê╩cê┬\\\\╠bê═─`ZZ╞Z╟#¡£╠bê╚╔\"ê╩cê╚╔\"ê╩cê┬\\\\ëç" [done (byte-code "└bêm¼╢g┴=¼ê┬êh┴=½ñ└bêm¼Ä├cê┬ê├cê┬uê¬o┼\\╞└!ê╟ ê╚╔╩\"ê┬yê¬G┬ç" [1 64 nil 32 fill-column 2 scroll-left life-compute-neighbor-deltas throw done t] 3) 1 search-forward "@" fill-column 2 t insert-char 32 10 life-window-start 33554431 search-backward] 6] life-display-generation #[(sleeptime) "bê┴┬!ê├!ç" [life-window-start recenter 0 sit-for sleeptime] 2] life-extinct-quit #[nil "└┴!ê┬├─\"ç" [life-display-generation 0 signal life-extinct nil] 3] life-extinct error-conditions (life-extinct quit) error-message "All life has perished"] 4)